﻿using Grow.EventBus.EventData;
using Grow.EventBus.EventHandler;
using Grow.Module.Builder;
using Grow.Module.Options;

namespace Grow.EventBus.CreateEventBus
{
    /// <summary>
    /// Eventbus 构建器
    /// </summary>
    public interface ICreateEventBusBuilder : IBuilder
    {

        /// <summary>
        /// 添加基础配置
        /// </summary>
        /// <param name="eventBusOptionsAction"></param>
        /// <returns></returns>
        ICreateEventBusBuilder AddEventBusOptions(Action<IOptionsBind, EventBusOptions> eventBusOptionsAction);

        ICreateEventBusBuilder AddEventData<TEventData>(Action<IOptionsBind, EventDataOptions> eventDataOptionsAction)
            where TEventData : IEventData;

        ICreateEventBusBuilder AddEventHandler<TEventHandler, TEventData>(Action<IOptionsBind, EventHandlerOptions> eventHandlerOptionsAction)
            where TEventHandler : class, IEventHandler<TEventData>
            where TEventData : IEventData;
    }
}
